/*
 * Created on 2005-7-11
 *
 */
package com.et114.components.ldap4oj.core;


import javax.naming.NamingException;
import javax.naming.directory.SearchResult;

public interface SearchResultCallbackHandler {
    

    /**
     * Implementations must implement this method to process each element of a
     * NamingEnumeration. The implementation doesn't have to care about
     * iterating in the enumeration.
     * 
     * @param searchResult
     *            the current item returned by the query
     * @throws NamingException
     *             if a NamingException is thrown during the processing
     */
    void processSearchResult(SearchResult searchResult) throws NamingException;

    /**
     * Implementation must provide a result value to be used at the end of the
     * iteration for returning to the caller of LdapTemplate
     * 
     * @return a return value
     */
    Object getResult();

}
